#pragma once  

#include <glm/glm.hpp>
#include <memory>
#include <string>
#include <SDL2/SDL_mixer.h>

struct SDL_Renderer;
struct SDL_Texture;
struct TTF_Font;

namespace engine  
{  
    namespace resource  
    {  
        class AudioManager;
        class FontManager;
        class TextureManager;

        class ResourceManager final  
        {
        public:
            ResourceManager(SDL_Renderer* renderer);
            ~ResourceManager();

            ResourceManager(const ResourceManager&) = delete;
            ResourceManager& operator=(const ResourceManager&) = delete;
            ResourceManager(ResourceManager&&) = delete;
			ResourceManager& operator=(ResourceManager&&) = delete;

			void clear();                                                                        //清除资源

            SDL_Texture* loadTexture(const std::string& filePath);    //加载纹理
			SDL_Texture* getTexture(const std::string& filePath);      //获取纹理
			void unloadTexture(const std::string& filePath);               //卸载纹理
			void clearTextures();                                                          //清除所有纹理

			Mix_Chunk* loadSound(const std::string& filePath);     //加载音效
			Mix_Chunk* getSound(const std::string& filePath);       //获取音效
			void unloadSound(const std::string& filePath);             //卸载音效
			void clearSounds();                                                        //清除所有音效

			Mix_Music* loadMusic(const std::string& filePath);     //加载音乐
			Mix_Music* getMusic(const std::string& filePath);       //获取音乐
			void unloadMusic(const std::string& filePath);             //卸载音乐
			void clearMusics();                                                        //清除所有音乐

			TTF_Font* loadFont(const std::string& filePath, int fontSize); //加载字体
			TTF_Font* getFont(const std::string& filePath, int fontSize);   //获取字体
			void unloadFont(const std::string& filePath, int fontSize);       //卸载字体
			void clearFonts();                                                          //清除所有字体

            private:
		    std::unique_ptr<AudioManager> m_audioManager = nullptr;      //音频管理器对象指针
			std::unique_ptr<FontManager> m_fontManager = nullptr;           //字体管理器对象指针
			std::unique_ptr<TextureManager> m_textureManager = nullptr; //纹理管理器对象指针
        }; 

    } // namespace resource  
} // namespace engine